How to Use Interactive Help
The SmartHub Helper Bot assists users with their search results.
For example, if a user gets no results returned to their query, the Bot might suggest popular alternatives (gathered from analytics) that are similar to what the user initially searched for.
About the Helper Bot
The SmartHub Helper Bot or "ChatBot" enables users to interact with SmartHub to quickly navigate and refine your queries.
Helper Bot Functionality
The Helper Bot provides the following options:
- Provides suggestions:
- Provides suggestions to partially-typed queries.
- For example, type "ad", and the Bot suggests "admin".
- Corrects queries for misspelled words:
- Suggests you remove filters that return no results:
- Suggests you modify your query if too many results are returned or if your query is too long:
- Suggests you filter your results if too many results are returned:
- Suggests removing your filter if it returns no results:
- Set to Automatically Trigger: You can set the Bot to automatically trigger if:
- You open a specific web page on your site
- You stay on a page for a set period.
User's First Chat with the Bot
- Start interacting with the Bot by clicking Need any assistance? on the bottom right side of the page:
-
See the expanded chat window:
-
Click the chat bubbles icon in the top right of the Bot window to refresh the chat bubble.
-
Click "I didn't find what I need!" to bring up the Personalization dialogue for more options to fine tune your query.
Too Many Results Returned - Filter Suggested
After some time without any user interaction, or after the user reaches a certain page, the Bot might suggest applying popular filters recorded with Analytics.
- The Bot window expands and displays the filters for the results.
- Filter your results by clicking one or more filters.
- At any time, dismiss the Bot to return the Bot to the side.
- Similarly, for a search query such as "sharepoint", the Bot might suggest a more specific query text based on analytics:
Bot Suggestions if User Pauses or Reaches End of Page
After some time without any user interaction or if the user scrolls at the end of the page, the Bot might suggest tuning your search.
-
Select "I didn't find what I need."
Based on the number of the displayed results, the bot does either of the following:-
Opens the personalization panel
-
Suggests other similar queries run with success by other users
-
No Results Returned
If no results are returned, the Bot tries the following:
- Checking the query text for misspelled words using a word dictionary.
- For example, if the query is "directionas".
- For example, if the query is "directionas".
- If there are no query results or the query text appears to be incorrect, but some filters are active, the Bot suggests removing some filters in order to obtain results:
- If steps 1 and 2 fail (or are not applicable) then the Bot searches analytics for a common query term that is close to the original query term:
- For example, if the query is "shaerpoint" the Bot would show:
- For example, if the query is "shaerpoint" the Bot would show:
How the Bot Uses Short-term Memory
The Bot enables the user to ask many natural language questions in sequence and it uses the current conversation context to understand and process the query.
Examples
User's 1st question: What are the open cases for Contoso?
- This question contains all the necessary information for the Bot to understand it: it has a subject: cases, case status: open, customer name: Contoso
- The question intent can be resolved and the Bot can list the results of its search.
User's 2nd question: Which ones are P1?
- This question is clearly missing the subject of the question while providing the priority (“P1”); this cannot be understood by the Bot unless there is context.
- The Bot reuses the context determined by the previous question to process the current question.
- As a result, the Bot filters the results previously displayed by priority "P1."
User's 3rd question: How about BA Insight?
- This question is missing the subject, but the value for the customer entity has changed.
- The Bot reuses the context determined by the previously run questions and updates it with the newly found information: customer name changed to "BA Insight."
- The Bot understands this to mean it should display results about P1 open cases submitted by BA Insight.
Conversation Context Behavior
- The conversation context is cleared out if the user refreshes the page.
- The conversation context is updated if the user switches from one subject to another.
How to Configure the Bot
Before continuing, familiarize yourself with the information in the topic How to Customize Your SmartHub User Interface.
-
To configure the Bot, copy the parameters around line 306 under
SH.Bot.DefaultSettings
in the file DefaultModuleSettings.js located in the directory <SmartHub_install_dir>\modules\SmartHubResourceLoader. -
Paste these settings into your page's custom settings file (such as "CustomResultsPageSettings.js") and modify the parameters from there.
-
Use the following table of Bot Parameters:
Parameters
Setting | Default Value | Description |
---|---|---|
BotDisabled
|
false |
false: Bot is enabled true: Bot is disabled (leave |
BotDisabledOnLanding
|
false |
false: Bot is enabled on landing page (Index.html) true: Bot is disabled on landing page |
hideBot
|
false |
false: Bot is displayed on page true: Bot is in silent mode (keeps Promoted Results and Spell checking functionality, but bot Container is not displayed on page) |
userNameProperty
|
preferedname | The user profile property that will be used by the Bot |
analyticsRefinerSuggestionNoOfSuggestions
|
5 | Number of refiner suggestions to show |
analyticsRelevantQueriesMinimumShouldMatch
|
75% | Similarity minimum percentage for suggesting a new query |
|
false |
false: When scrolling to the Bottom of the page the irrelevant results pop up will show up true: Irrelevant results pop up is disabled and will never appear |
|
300 | Value is in milliseconds. The time to wait before trying to suggest a query in the chat Bot search box |
|
false |
false: Bot short term memory is enabled true: Bot short term memory is disabled |
|
'left' |
'left': the options provided by the Bot are on the left side 'right': the options provided by the Bot are on the right side |
pickedOptionPosition
|
'right' |
'left': the selected option is on the left side 'right': the selected option is on the right side |
collapsedOnLanding
|
true |
true: Bot stays collapsed when reaching the landing page false: Bot expands when reaching the landing page |
defaultUserNickName
|
human
|
This is how the bot addresses the user (with no authentication). Normally, the authentication name is used. |
BotName
|
SH.Bot
|
This is how the bot introduces itself. |
BotTemplatePath
|
/modules/ChatBot/fwk/template.html
|
The path to the bot window underscore template. |
UserProfileServiceURL
|
/Services/UserProfileService.svc
|
The URL for the user profile service (required for analytics). |
tooManyResultsRightSiblingSelector
|
.CoveoResult:nth-child(6)
|
Where the Bot window moves when events are triggered (too many results). |
noResultsResultsRightSiblingSelector
|
.CoveoExportToExcel
|
Where the Bot window moves when events are triggered (no results). |
minNumberOfResultsForTooManyResultsNthPage
|
1000
|
The minimum number of results required for the Bot to give a too many results suggestion if the user has reached the tooManyResultsPage. |
tooManyResultsPage
|
2z
|
The results page the user has to be on when the Bot gives a too many results suggestion (if there are more results than minNumberOfResultsForTooManyResultsNthPage ) |
tooManyResultsWaitTimeSeconds
|
60
|
The amount of time (that the user is inactive) before the Bot gives a too many results suggestion. |
analyticsRefinerSuggestionAlgorithmId
|
Refined2
|
The algorithm (query) used by analytics to determine refiner suggestions. |
analyticsFuzzyMatchAlgorithmId
|
3
|
The algorithm (query) used by analytics to determine a similar query (in the case of no results). |
analyticsUserPastQueries
|
3 | The maximum number of past queries required for the Bot to give Resume where I left off suggestions. |
maxCorrectionDistance
|
2
|
|
templatePaths
|
|
Finally, set the new path in your custom settings page: Copy
To remove one of the options the Bot says, use For instance, to remove the 'change nickname' option, add its path to Copy
|
How to Select what the ChatBot Displays
The options displayed by Bot can be configured via the DefaultModuleSettings.js file located in the directory \modules\SmartHubResourceLoader\.
botActions: {
'ResumeWork': {
'label': 'Resume where I left off'.toLocaleString(),
'jsEvaluator': 'EnableResumeWorkAction',
'jsHandler': 'ExecuteResumeWorkAction',
'disabled': false,
'position': 1
},
'GetUpdatesForSavedQueries': {
'label': 'See new documents for my saved queries'.toLocaleString(),
'jsEvaluator': 'EnableUpdatesForSavedQueries',
'jsHandler': 'ExecuteUpdatesForSavedQueries',
'disabled': false,
'position': 2
},
'TooManyResults': {
'label': 'I see too many results!'.toLocaleString(),
'jsEvaluator': 'EnableTooManyResultsAction',
'jsHandler': 'ExecuteTooManyResultsAction',
'disabled': false,
'position': 6
},
'BadResults': {
'label': "I didn't find what I need!".toLocaleString(),
'jsEvaluator': 'EnableBadResultsAction',
'jsHandler': 'ExecuteBadResultssAction',
'disabled': false,
'position': 7
},
},
Setting | Description |
---|---|
label | This value appears in ChatBot. |
jsEvaluator |
JavaScript function implemented in the SH.Bot.Actions namespace or exposed in window.
|
jsHandler |
This function defines the ChatBot behavior once the user selects the option.
Copy
|
disabled |
|
position |
|
How to Disable the ChatBot (Prevent it From Loading)
To disable the ChatBot you set the BotDisabled
parameter to true.
Use the following steps to perform this action:
- Navigate to the custom settings file that is associated with the page you are disabling the Bot for.
- Results Page Example:
- For the Results page, your custom HTML file is ResultsCopy.html.
- The associated settings file is ResultsCopyCustomSettings.js.
- Index Page Example:
- For the Index page, your custom HTML file is IndexCopy.html.
- The associated settings file is IndexCopyCustomSettings.js.
- Results Page Example:
- Open the component's settings, located around line 306 in "\modules\SmartHubResourceLoader\DefaultModuleSettings.js".
- Copy the setting you want to change, in this case,
BotDisabled
. - Paste the setting into your custom Index settings file on the line where the component setting is located, around line 130 in this case.
For more information, see How to Customize Your SmartHub User Interface. - Below is a screenshot of our custom Index settings file.
TheBotDisabled
setting is set to "true
." - The ChatBot will NOT load as a result of this setting.
- Changing the setting to "
false
" reverses the behavior.
- Changing the setting to "
How to Remove the Bot from a Page
For more information, see How to Customize Your SmartHub User Interface.
- Navigate to the custom settings file that is associated with the page you are disabling the bot for.
-
Update the
PathsToExclude
parameter with the path to the file "ChatBot.js", shown in the code block below:-
In the IndexCopyCustomSettings.js file, this is around line 15.
CopySH.Loader.PathsToExclude = [
"/modules/ChatBot/ChatBot.js" /*
['/modules/Analytics/AnalyticsLoader.js', 'params', 'id'],
['/modules/Ribbon/ribbon.css']
*/
]; -
- Save the file and close it.